<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <link href="https://cdn.bootcss.com/normalize/7.0.0/normalize.css" rel="stylesheet">
    <link href="https://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.css" rel="stylesheet">
    <script src="https://cdn.bootcss.com/jquery/3.4.1/jquery.js"></script>
    <script src="https://cdn.bootcss.com/twitter-bootstrap/3.4.1/js/bootstrap.js"></script>
    <!--3.验证规则样式-->
    <link href="https://cdn.bootcss.com/jquery.bootstrapvalidator/0.5.3/css/bootstrapValidator.css" rel="stylesheet">
    <!--4.核心验证文件-->
    <script src="https://cdn.bootcss.com/jquery.bootstrapvalidator/0.5.3/js/bootstrapValidator.js"></script>
    <!--5.中文校验-->
    <script src="https://cdn.bootcss.com/jquery.bootstrapvalidator/0.5.3/js/language/zh_CN.js"></script>
    <script>
        $(function () {
            let data = {
                page: 1,
                size: 10
            }
            $.post("http://localhost:8080/warehouse/selectwarehousemangagment", data, function (result) {
                if (result.status === 200) {
                    let page = result.data

                    if (page.data.length > 0) {
                        for (let i = 0; i < page.data.length; i++) {
                            let customer = page.data[i]
                            // alert(customer.goodsName);
                            $("#content")
                                .append(
                                    $("<tr>")
                                        .append(
                                            $("<td>")
                                                .text(i)
                                                .addClass("text-center")
                                        )
                                        .append(
                                            //添加客户名称
                                            $("<td>")
                                                .text(customer.goodsName)
                                                .addClass("text-center")
                                        )
                                        // 添加所属行业
                                        .append(
                                            $("<td>")
                                                .text(customer.supplier)
                                                .addClass("text-center")
                                        )
                                        // 所在城市
                                        .append(
                                            $("<td>")
                                                .text(customer.keepWarehouse)
                                                .addClass("text-center")
                                        )
                                        // 联系人
                                        .append(
                                            $("<td>")
                                                .text(customer.inWarehouseTime)
                                                .addClass("text-center")
                                        )
                                        // 操作
                                        /*.append(
                                            $("<td>")
                                                .append(
                                                    $("<button class='btn btn-info off col-lg-offset-3'>编辑</button>").click(function () {
                                                        // window.location.href = "detailedMSG.html?id=" + customer.cid
                                                    }))
                                                .append($("<button class='btn btn-danger col-lg-offset-2'>删除</button>").click(function () {
                                                    let data = {
                                                        name: customer.goodsName
                                                    }
                                                    alert("正在在删除id=" + i + "的货物：" + data.name)
                                                    /!*$.get("http://localhost:8080/customer/delete", data, function (result) {
                                                        alert(1)
                                                        if (result.status) {
                                                            alert(result.status)
                                                            window.location.href = "listPage.html"
                                                        }
                                                    })*!/
                                                }))
                                        )*/
                                )
                        }
                    } else {
                        $("#content")
                            .before($("<p>暂无数据</p>"))
                            .hide();
                    }

                    /**
                     <li>
                     <a href="#" aria-label="Previous">
                     <span aria-hidden="true">&laquo;</span>
                     </a>
                     </li>
                     */

                    /*$("<li>")
                        .append($("<a aria-label='Previous'></a>")
                            .append($("<span aria-hidden='true'></span>")
                                .html("&laquo"))
                        )

                    for (let i = 0; i < Math.ceil(page.total / page.size); i++) {
                        $("#pag").append(
                            $("<li>")
                                .append($("<a href='#' id='yema'>" + (i + 1) + "</a>")).click(function () {

                            })
                        )
                    }*/

                } else {
                    $("#content")
                        .before($("<p>暂无数据</p>"))
                        .hide();
                }
            })
        })
        /*$(function () {
            $("#customer").click(function () {
                window.location.href = "addCustomer.html"
            })
        })
        $(function () {
            $("#clssify").click(function () {
                let cClassify = $("#feilei").val()
                window.location.href = "classify.html?classification=" + cClassify
            })
        })
        $(function () {
            $("#query").click(function () {
                let querySelect = $("#select").val()
                window.location.href = "pirmaryquery.html?primaryKey=" + querySelect
            })
        })*/

    </script>
</head>
<body>
<div class="container-fluid">
    <div class="row clearfix">
        <div class="" style="border: solid 1px #dddddd; height: 60px; line-height: 60px; margin-bottom: 20px">
            <span type="text" class="col-lg-1" style="font-size: 25px;line-height: 60px; ">库存管理</span>
            <a href="outwareindex.html" class="btn btn-default col-lg-offset-1">出库单</a>
            <a href="inwareindex.html" class="btn btn-default ">入库单</a>
        </div>
        <div class="container pull-left" style="border: #9F9F9F;height: 40px; ">
            <div class="clearfix">
                <form class="form-inline" style=" width: 100%; margin: 0 auto">
                    <div class="form-group">
                        <label class="sr-only" for="keyword"></label>
                        <div class="input-group ">
                            <input type="text" class="form-control col-lg-offset-0" id="keyword" placeholder="请输入关键字">
                        </div>
                    </div>
                    <!--                    <button type="submit" class="btn btn-primary col-lg-offset-1">查找</button>-->
                    <a href="" class="btn btn-info">查找</a>

                    <a href="inwarehouse.html" class="btn btn-default" style="float: right">新增入库单</a>
                </form>
            </div>

        </div>
        <div class="container-fluid">
            <table id="content" class="table table-bordered table-condensed table-striped table-hover ">
                <tr>
                    <th class="text-center">序号</th>
                    <th class="text-center">货物名称</th>
                    <th class="text-center">供应商名称</th>
                    <th class="text-center">入库仓库</th>
                    <th class="text-center">入库时间</th>
<!--                    <th class="text-center">操作</th>-->
                </tr>
            </table>
        </div>
        <div class="col-md-offset-5">
            <nav aria-label="Page navigation">
                <ul class="pagination">
                    <li>
                        <a href="#" aria-label="Previous">
                            <span aria-hidden="true">&laquo;</span>
                        </a>
                    </li>
                    <li><a href="#">1</a></li>
                    <li><a href="#">2</a></li>
                    <li><a href="#">3</a></li>
                    <li><a href="#">4</a></li>
                    <li><a href="#">5</a></li>
                    <li>
                        <a href="#" aria-label="Next">
                            <span aria-hidden="true">&raquo;</span>
                        </a>
                    </li>
                </ul>
            </nav>
        </div>
    </div>
</div>
</body>
</html>